﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Framework.CapaDeDatos.Proveedores;
using Framework.CapaDeDatos.Excepciones;

namespace Framework.CapaDeDatos
{
    public class Contenedor : IContenedor
    {
        #region Private Fields
        private IProveedor proveedor;
        #endregion

        #region Public Constructors

        public Contenedor( IProveedor proveedor )
        {
            if (proveedor != null)
                this.proveedor = proveedor;
            else
                throw new ExceptionParametroNulo();
        }

        #endregion

        #region IContenedor Members

        public Framework.Modelo.IObjeto Guardar( Framework.Modelo.IObjeto objeto )
        {
            return this.proveedor.Guardar( objeto );
        }

        public Framework.Modelo.IObjeto Recuperar( Guid guid )
        {
            return this.proveedor.Recuperar( guid );
        }

        #endregion
    }
}
